package com.yegs.jltqc.U8Controller;

import com.yegs.jltqc.TO.NamePageQuery;
import com.yegs.jltqc.TO.PpbarcodePageQuery;
import com.yegs.jltqc.TO.QcProducePageQuery;
import com.yegs.jltqc.U8Service.PpbarcodeService;
import com.yegs.jltqc.U8Service.U8VendorService;
import com.yegs.jltqc.config.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/ppbarcode")
public class PpbarcodeController {

    @Autowired
    private PpbarcodeService ppbarcodeService;

    @GetMapping("/findByBarcode")
    public Msg findByBarcode(@RequestParam String barcode){
        return Msg.success("page",ppbarcodeService.findByBarcode(barcode));
    }
    @PostMapping("/query")
    public Msg query(@RequestBody PpbarcodePageQuery query){
        return Msg.success("page",ppbarcodeService.query(query));
    }

    @GetMapping("/findAllByModid")
    public Msg query(@RequestParam Long modid){
        return Msg.success("page",ppbarcodeService.findAllByModid(modid));
    }


    @GetMapping("/getccode")
    public Msg getccode(){
        return Msg.success("page",ppbarcodeService.getCCode());
    }
}
